﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;

namespace WMI.NET.CIM
{
    /// <summary>
    /// The CIM_SCSIController class represents the capabilities and management of the SCSI controller logical device.
    /// </summary>
    public class CIM_SCSIController : CIM_Controller
    {

        private Nullable<UInt32> _ControllerTimeouts;
        private Nullable<UInt32> _MaxDataWidth;
        private Nullable<UInt64> _MaxTransferRate;
        private Nullable<UInt16> _ProtectionManagement;

        /// <summary>
        /// Number of SCSI controller time-outs that have occurred since the last reset.
        /// </summary>
        public Nullable<UInt32> ControllerTimeouts { get { return _ControllerTimeouts; } }

        /// <summary>
        /// Maximum data width, in bits, supported by the SCSI controller.
        /// </summary>
        public Nullable<UInt32> MaxDataWidth { get { return _MaxDataWidth; } }

        /// <summary>
        /// Maximum transfer rate, in bits-per-second, supported by the SCSI controller.
        /// </summary>
        public Nullable<UInt64> MaxTransferRate { get { return _MaxTransferRate; } }

        /// <summary>
        /// Indicates whether the SCSI controller provides redundancy or protection against device failures.
        /// </summary>
        public Nullable<UInt16> ProtectionManagement { get { return _ProtectionManagement; } } //TODO enum


        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public CIM_SCSIController(ManagementBaseObject mbo)
            :base(mbo)
        {
            _ControllerTimeouts = mbo.GetUIntValue("ControllerTimeouts");
            _MaxDataWidth = mbo.GetUIntValue("MaxDataWidth");
            _MaxTransferRate = mbo.GetUlongValue("MaxTransferRate");
            _ProtectionManagement = mbo.GetUshortValue("ProtectionManagement");
        }

    }
}
